package com.lian.pet.domain.vo;

import com.lian.pet.domain.entity.PetEvent;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

@AllArgsConstructor
@Data
@Builder
@ApiModel("查询活动信息")
public class PetEventVO {
    private Integer id;
    @ApiModelProperty(value = "活动名称")
    private String name;
    @ApiModelProperty(value = "活动类型")
    private String type;
    @ApiModelProperty(value = "活动地点")
    private String location;
    @ApiModelProperty(value="活动描述")
    private String description;
    @ApiModelProperty(value = "活动开始时间")
    private Date date_start;
    @ApiModelProperty(value = "活动结束时间")
    private Date date_end;

    public static PetEventVO fromPetEvent(PetEvent entity) {
        return PetEventVO.builder()
                .id(entity.getId())
                .name(entity.getName())
                .type(entity.getType())
                .location(entity.getLocation())
                .description(entity.getDescription())
                .date_start(entity.getDate_start())
                .date_end(entity.getDate_end())
                .build();
    }
}
